#pragma once

#include <QtWidgets/QMainWindow>
#include "ui_RayTracing.h"
#include <qpainter.h>
#include <qvector3d.h>
#include "Objects.h"
#include <qmenu.h>
#include <qmessagebox.h>
#include <qfiledialog.h>
#include <qfile.h>
#include <qdatastream.h>
#include <qjsonobject.h>
#include <qjsonarray.h>
#include <qjsondocument.h>
#include <qprocess.h>
#include "TriangleSetting.h"
#include "SphereSetting.h"
#include "FileManager.h"


class RayTracing : public QMainWindow
{
    Q_OBJECT

public:
    RayTracing(QWidget *parent = Q_NULLPTR);

    static int const EXIT_CODE_REBOOT;

private slots:
    void onObjListMenuRequested(const QPoint& pos);
    void onActionDelete(); 
    void onActionEdit();
    void onActionEdit(QListWidgetItem* item);
    void onActionRename();
    void onActionCreateSphere();
    void onActionCreateTriangle();
    void onCameraUpdate(double);
    void onSaveFile();
    void onOpenFile();
    void onNewFile();
    void onExport();

private:
    Ui::RayTracingClass ui;
    QPixmap view;
    QMap<QListWidgetItem*,obj*> objMap;
    QMenu* objMenu;
    QMenu* addObjMenu;
    QAction* addSphereAction;
    QAction* addTriangleAction;
    QAction* editObjAction;
    QAction* delObjAction;
    QAction* renameObjAction;
    TriangleSettingDialog* triDia;
    SphereSettingDialog* sphDia;
};

